<template>
 <div>
     <h1>我是B组件</h1>
     <h3>{{msg}}</h3>
 </div>
</template>

<script>
import vm from '../../utils/vm'
export default {
    data(){
         return{
             msg:'666'
         }
    },
    created(){
        // 接收
        vm.$on('sendMsg',(val)=>{
            console.log(val)
            console.log(this)
            this.msg = val
        })
    },
    methods:{},
    components:{}
}

</script>
<style scoped>
</style>